/**
 * Copyright &copy; 2015-2020 <a href="www.dsesa.cn/">ESA</a> All rights reserved.
 */
package com.jeeplus.modules.basedata.actFlow.web;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jeeplus.modules.basedata.actFlow.entity.ActFlow;
import com.jeeplus.modules.basedata.actFlow.service.ActFlowService;
import com.jeeplus.modules.buzz.sysno.mapper.SysNoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.web.BaseController;
import com.jeeplus.common.utils.StringUtils;

/**
 * absController
 * @author abs
 * @version 2020-02-28
 */
@Controller
@RequestMapping(value = "${adminPath}/basedata/actFlow/actFlow")
public class ActFlowController extends BaseController {

	@Autowired
	private ActFlowService actFlowService;

	@Autowired
	SysNoMapper sysNoMapper;

	@ModelAttribute
	public ActFlow get(@RequestParam(required=false) String id) {
		ActFlow entity = null;
		if (StringUtils.isNotBlank(id)){
			entity = actFlowService.get(id);
		}
		if (entity == null){
			entity = new ActFlow();
		}
		return entity;
	}


	/**
	 * abs列表数据
	 */
	@ResponseBody
	@RequestMapping(value = "data")
	public Map<String, Object> data(ActFlow actFlow, HttpServletRequest request, HttpServletResponse response, Model model) {
		Page<ActFlow> page = actFlowService.findPage(new Page<ActFlow>(request, response), actFlow);
		return getBootstrapData(page);
	}

}
